Don't show `Fresh` by default
authorAlex Crichton <alex@alexcrichton.com>
Fri, 5 Sep 2014 17:15:10 +0000 (10:15 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 5 Sep 2014 17:16:21 +0000 (10:16 -0700)
But still show it with --verbose

Closes #473

src/cargo/ops/cargo_rustc/job_queue.rs
tests/test_cargo_bench.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_path_deps.rs
tests/test_cargo_doc.rs
tests/test_cargo_freshness.rs
tests/test_cargo_test.rs

index abda5ff79b381143cb33966c30d34c6320f3436c..bc5d2171871dc42c0c3b23581c5040832933b1cb 100644 (file)
@@ -147,9 +147,12 @@ impl<'a, 'b> JobQueue<'a, 'b> {
         let id = pkg.get_package_id().clone();
 
         if stage == StageStart {
-            let fresh = fresh.combine(self.state[pkg.get_package_id()]);
-            let msg = match fresh { Fresh => "Fresh", Dirty => "Compiling" };
-            try!(config.shell().status(msg, pkg));
+            match fresh.combine(self.state[pkg.get_package_id()]) {
+                Fresh => try!(config.shell().verbose(|c| {
+                    c.status("Fresh", pkg)
+                })),
+                Dirty => try!(config.shell().status("Compiling", pkg))
+            }
         }
 
         // While the jobs are all running, we maintain some metadata about how
index 26dfe4d908850f4966d096709ce0005d186f0eff..ed878ef28819f51e121fc273c697cd8b256fa372 100644 (file)
@@ -739,7 +739,6 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
     assert_that(p.process(cargo_dir().join("cargo")).arg("bench"),
                 execs().with_status(0)
                        .with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
 {running} target[..]release[..]foo-[..]
 
 running 1 test
@@ -748,6 +747,5 @@ test foo ... bench:         0 ns/iter (+/- 0)
 test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
 
 ",
-                       fresh = FRESH, running = RUNNING,
-                       dir = p.url()).as_slice()));
+                       running = RUNNING)));
 })
index 9c754cc347e9365f0fd4bc50a0640f33b06aa68b..46b08f7ecbc74cae886a7d3c3f97417463d16254 100644 (file)
@@ -3,7 +3,7 @@ use std::os;
 use std::path;
 
 use support::{ResultTest, project, execs, main_file, basic_bin_manifest};
-use support::{COMPILING, RUNNING, FRESH, cargo_dir, ProjectBuilder, path2url};
+use support::{COMPILING, RUNNING, cargo_dir, ProjectBuilder, path2url};
 use hamcrest::{assert_that, existing_file};
 use support::paths::PathExt;
 use cargo;
@@ -1577,18 +1577,14 @@ test!(freshness_ignores_excluded {
     println!("first pass");
     assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0)
-                       .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+                       .with_stdout(""));
 
     // Modify an ignored file and make sure we don't rebuild
     println!("second pass");
     File::create(&foo.root().join("src/bar.rs")).assert();
     assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0)
-                       .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+                       .with_stdout(""));
 })
 
 test!(rebuild_preserves_out_dir {
index 15bd3195edc16791320d5e01ada1e5633b68cbaf..90e66ca7a52bc7577e049b03216de8cbc80f21a4 100644 (file)
@@ -3,7 +3,7 @@ use std::time::Duration;
 
 use support::{ProjectBuilder, ResultTest, project, execs, main_file, paths};
 use support::{cargo_dir, path2url};
-use support::{COMPILING, FRESH, UPDATING, RUNNING};
+use support::{COMPILING, UPDATING, RUNNING};
 use support::paths::PathExt;
 use hamcrest::{assert_that,existing_file};
 use cargo;
@@ -531,10 +531,7 @@ test!(recompilation {
 
     // Don't recompile the second time
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, git_project.url(),
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
 
     // Modify a file manually, shouldn't trigger a recompile
     File::create(&git_project.root().join("src/bar.rs")).write_str(r#"
@@ -542,10 +539,7 @@ test!(recompilation {
     "#).assert();
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, git_project.url(),
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("update"),
                 execs().with_stdout(format!("{} git repository `{}`",
@@ -553,10 +547,7 @@ test!(recompilation {
                                             git_project.url())));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, git_project.url(),
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
 
     // Commit the changes and make sure we don't trigger a recompile because the
     // lockfile says not to change
@@ -566,10 +557,7 @@ test!(recompilation {
 
     println!("compile after commit");
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({}#[..])\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, git_project.url(),
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
     p.root().move_into_the_past().assert();
 
     // Update the dependency and carry on!
@@ -1047,18 +1035,14 @@ test!(git_build_cmd_freshness {
     println!("first pass");
     assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0)
-                       .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+                       .with_stdout(""));
 
     // Modify an ignored file and make sure we don't rebuild
     println!("second pass");
     File::create(&foo.root().join("src/bar.rs")).assert();
     assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0)
-                       .with_stdout(format!("\
-{fresh} foo v0.0.0 ({url})
-", fresh = FRESH, url = foo.url())));
+                       .with_stdout(""));
 })
 
 test!(git_name_not_always_needed {
index b04fe63c293d31b8493fa3535d4cc9ab48a51ae1..a872a69939b2e10a8c9a83f6d40d8858b2968c2e 100644 (file)
@@ -1,7 +1,7 @@
 use std::io::{fs, File, UserRWX};
 
 use support::{ResultTest, project, execs, main_file, cargo_dir, path2url};
-use support::{COMPILING, FRESH, RUNNING};
+use support::{COMPILING, RUNNING};
 use support::paths::{mod, PathExt};
 use hamcrest::{assert_that, existing_file};
 use cargo;
@@ -266,10 +266,7 @@ test!(no_rebuild_dependency {
                                             COMPILING, p.url())));
     // This time we shouldn't compile bar
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, bar,
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
     p.root().move_into_the_past().assert();
 
     p.build(); // rebuild the files (rewriting them in the process)
@@ -343,12 +340,7 @@ test!(deep_dependencies_trigger_rebuild {
                                             COMPILING, bar,
                                             COMPILING, p.url())));
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
-                                             {} bar v0.5.0 ({})\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, baz,
-                                            FRESH, bar,
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
 
     // Make sure an update to baz triggers a rebuild of bar
     //
@@ -373,12 +365,11 @@ test!(deep_dependencies_trigger_rebuild {
         pub fn bar() { println!("hello!"); baz::baz(); }
     "#).assert();
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
-                                             {} bar v0.5.0 ({})\n\
+                execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
                                              {} foo v0.5.0 ({})\n",
-                                            FRESH, baz,
                                             COMPILING, bar,
                                             COMPILING, p.url())));
+
 })
 
 test!(no_rebuild_two_deps {
@@ -445,12 +436,7 @@ test!(no_rebuild_two_deps {
                                             COMPILING, p.url())));
     assert_that(&p.bin("foo"), existing_file());
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} baz v0.5.0 ({})\n\
-                                             {} bar v0.5.0 ({})\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, baz,
-                                            FRESH, bar,
-                                            FRESH, p.url())));
+                execs().with_stdout(""));
     assert_that(&p.bin("foo"), existing_file());
 })
 
@@ -501,9 +487,7 @@ test!(nested_deps_recompile {
 
     // This shouldn't recompile `bar`
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_stdout(format!("{} bar v0.5.0 ({})\n\
-                                             {} foo v0.5.0 ({})\n",
-                                            FRESH, bar,
+                execs().with_stdout(format!("{} foo v0.5.0 ({})\n",
                                             COMPILING, p.url())));
 })
 
index 585bb4ae43fe9480ac63aa42f5a0f5335283c9df..71d33183905f8b89472a4741f97070ab671931ef 100644 (file)
@@ -1,5 +1,5 @@
 use support::{project, execs, cargo_dir, path2url};
-use support::{COMPILING, FRESH};
+use support::COMPILING;
 use hamcrest::{assert_that, existing_file, existing_dir, is_not};
 
 fn setup() {
@@ -67,11 +67,7 @@ test!(doc_twice {
         dir = path2url(p.root())).as_slice()));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("doc"),
-                execs().with_status(0).with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
-",
-        fresh = FRESH,
-        dir = path2url(p.root())).as_slice()));
+                execs().with_status(0).with_stdout(""))
 })
 
 test!(doc_deps {
@@ -113,12 +109,7 @@ test!(doc_deps {
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("doc")
                  .env("RUST_LOG", Some("cargo::ops::cargo_rustc::fingerprint")),
-                execs().with_status(0).with_stdout(format!("\
-{fresh} bar v0.0.1 ({dir})
-{fresh} foo v0.0.1 ({dir})
-",
-        fresh = FRESH,
-        dir = path2url(p.root())).as_slice()));
+                execs().with_status(0).with_stdout(""));
 
     assert_that(&p.root().join("target/doc"), existing_dir());
     assert_that(&p.root().join("target/doc/foo/index.html"), existing_file());
index 1467071bdb7349f3dc9ada83243f8c1d1117e01d..4f78183a93f4bc352595713c48de2de32acc7c9e 100644 (file)
@@ -1,7 +1,7 @@
 use std::io::{fs, File};
 
 use support::{project, execs, path2url};
-use support::{COMPILING, cargo_dir, ResultTest, FRESH};
+use support::{COMPILING, cargo_dir, ResultTest};
 use support::paths::PathExt;
 use hamcrest::{assert_that, existing_file};
 
@@ -26,9 +26,7 @@ test!(modifying_and_moving {
 ", compiling = COMPILING, dir = path2url(p.root()))));
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
-                execs().with_status(0).with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
-", fresh = FRESH, dir = path2url(p.root()))));
+                execs().with_status(0).with_stdout(""));
     p.root().move_into_the_past().assert();
 
     File::create(&p.root().join("src/a.rs")).write_str("fn main() {}").assert();
index fbe4cbf27dfba5ec7c485cb7256f5663d56534a7..a7685e08547524c3604c16d7b5007fcfbd57ae90 100644 (file)
@@ -2,7 +2,7 @@ use std::path;
 use std::str;
 
 use support::{project, execs, basic_bin_manifest, basic_lib_manifest};
-use support::{COMPILING, cargo_dir, ResultTest, FRESH, RUNNING, DOCTEST};
+use support::{COMPILING, cargo_dir, ResultTest, RUNNING, DOCTEST};
 use support::paths::PathExt;
 use hamcrest::{assert_that, existing_file};
 use cargo::util::process;
@@ -722,8 +722,6 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
     assert_that(p.process(cargo_dir().join("cargo")).arg("test"),
                 execs().with_status(0)
                        .with_stdout(format!("\
-{fresh} bar v0.0.1 ({dir})
-{fresh} foo v0.0.1 ({dir})
 {running} target[..]foo-[..]
 
 running 1 test
@@ -745,9 +743,9 @@ running 0 tests
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-                       fresh = FRESH, running = RUNNING,
-                       doctest = DOCTEST,
-                       dir = p.url()).as_slice()));
+                       running = RUNNING,
+                       doctest = DOCTEST)));
+
 })
 
 test!(test_twice_with_build_cmd {
@@ -789,7 +787,6 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
     assert_that(p.process(cargo_dir().join("cargo")).arg("test"),
                 execs().with_status(0)
                        .with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
 {running} target[..]foo-[..]
 
 running 1 test
@@ -804,9 +801,8 @@ running 0 tests
 test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
 ",
-                       fresh = FRESH, running = RUNNING,
-                       doctest = DOCTEST,
-                       dir = p.url()).as_slice()));
+                       running = RUNNING,
+                       doctest = DOCTEST)));
 })
 
 test!(test_then_build {
@@ -846,11 +842,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
 
     assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
                 execs().with_status(0)
-                       .with_stdout(format!("\
-{fresh} foo v0.0.1 ({dir})
-",
-                       fresh = FRESH,
-                       dir = p.url()).as_slice()));
+                       .with_stdout(""));
 })
 
 test!(test_no_run {